﻿using Wicresoft.RDW.Interface;
using Wicresoft.RDW.Model;
using System.Configuration;

namespace Wicresoft.RDW.Presentation
{
    public class SysSettingPresent : BasePresent<SysSetting, ISysSetting>
    {
        public static string DefaultCreditScore
        {
            get
            {
                var sysSetting = present.GetByCondition(p => p.Key == "DefaultCreditScore");
                string defaultCreditScore = sysSetting.Value;
                return defaultCreditScore;
            }
        }
        public static string ApplyBeforeHour
        {
            get
            {
                var sysSetting = present.GetByCondition(p => p.Key == "ApplyBeforeHour");
                string applyBeforeHour = sysSetting.Value;
                return applyBeforeHour;
            }
        }
        public static string ApproveWaitingDay
        {
            get
            {
                var sysSetting = present.GetByCondition(p => p.Key == "ApproveWaitingDay");
                string approveWaitingDay = sysSetting.Value;
                return approveWaitingDay;
            }
        }
        public static string ApplyPeriodMinute
        {
            get
            {
                var sysSetting = present.GetByCondition(p => p.Key == "ApplyPeriodMinute");
                string applyPeriodMinute = sysSetting.Value;
                return applyPeriodMinute;
            }
        }
        public static string CancelBeforeHour
        {
            get
            {
                var sysSetting = present.GetByCondition(p => p.Key == "CancelBeforeHour");
                string cancelBeforeHour = sysSetting.Value;
                return cancelBeforeHour;
            }
        }
        public static string FeedbackEmailRemindDay
        {
            get
            {
                var sysSetting = present.GetByCondition(p => p.Key == "FeedbackEmailRemindDay");
                string feedbackEmailRemindDay = sysSetting.Value;
                return feedbackEmailRemindDay;
            }
        }
        public static string FeedbackCompleteMonth
        {
            get
            {
                var sysSetting = present.GetByCondition(p => p.Key == "FeedbackCompleteMonth");
                string feedbackCompleteMonth = sysSetting.Value;
                return feedbackCompleteMonth;
            }
        }
        public static string CreditScoreIncrease
        {
            get
            {
                var sysSetting = present.GetByCondition(p => p.Key == "CreditScoreIncrese");
                string creditScoreIncrease = sysSetting.Value;
                return creditScoreIncrease;
            }
        }
        public static string CreditScoreDecrease
        {
            get
            {
                var sysSetting = present.GetByCondition(p => p.Key == "CreditScoreDecrese");
                string creditScoreDecrease = sysSetting.Value;
                return creditScoreDecrease;
            }
        }
        public static string MinCreditScore
        {
            get
            {
                var sysSetting = present.GetByCondition(p => p.Key == "MinCreditScore");
                string minCreditScore = sysSetting.Value;
                return minCreditScore;
            }
        }
        public static string MaxCreditScore
        {
            get
            {
                var sysSetting = present.GetByCondition(p => p.Key == "MaxCreditScore");
                string maxCreditScore = sysSetting.Value;
                return maxCreditScore;
            }
        }
        //public static string ApplicationUrl
        //{
        //    get
        //    {
        //        var sysSetting = present.GetByCondition(p => p.Key == "ApplicationUrl");
        //        string applicationUrl = sysSetting.Value;
        //        return applicationUrl;
        //    }
        //}

        public static int AdminRoleId
        {
            get
            {
                int id;
                int.TryParse(ConfigurationManager.AppSettings["AdminRoleId"], out id);
                return id;
            }
        }
        public static int CenterManagerRoleId
        {
            get
            {
                int id;
                int.TryParse(ConfigurationManager.AppSettings["CenterManagerRoleId"], out id);
                return id;
            }
        }
    }
}
